'''
Author:
    编程思维
微信公众号:
    coding-thinking
'''
##########加密操作##########
strApple = "HelloWorld"

#进行ASCII编码转换
ascii_values = [ord(char) for char in strApple]

#输出 [97, 112, 112, 108, 101]
print(ascii_values)

##########解密操作##########
#一个包含ASCII码值的列表
ascii_values = [74, 111, 43, 29, 69, 29, 94, 107, 97, 29, 74, 111, 43, 29, 74, 29, 101, 94, 97, 29, 94, 29, 105, 108, 107, 100, 29, 96, 108, 107, 99, 102, 97, 98, 107, 113, 102, 94, 105, 29, 96, 108, 107, 115, 98, 111, 112, 94, 113, 102, 108, 107, 29, 94, 95, 108, 114, 113, 29, 113, 101, 98, 29, 99, 102, 111, 112, 113, 29, 112, 113, 98, 109, 29, 108, 99, 29, 113, 101, 98, 29, 116, 94, 111, 43, 29, 74, 111, 43, 29, 69, 29, 95, 98, 105, 102, 98, 115, 98, 112, 29, 113, 101, 94, 113, 29, 116, 98, 29, 112, 101, 108, 114, 105, 97, 29, 112, 113, 94, 111, 113, 29, 99, 111, 108, 106, 29, 64, 108, 114, 107, 113, 111, 118, 29, 63, 41, 29, 94, 107, 97, 29, 116, 98, 29, 101, 94, 115, 98, 29, 94, 105, 111, 98, 94, 97, 118, 29, 112, 113, 94, 111, 113, 98, 97, 29, 109, 111, 98, 109, 94, 111, 102, 107, 100]


# 使用列表推导式将所有ASCII码值转换为字符
strApple = [chr(ascii_value) for ascii_value in ascii_values]

# 将字符列表拼接成一个字符串
word = ''.join(strApple)

# 输出: aplle
print(word)


